<?php
/**
 * Created by JetBrains PhpStorm.
 * User: avnovoselov
 * Date: 21.10.12
 * Time: 13:08
 * To change this template use File | Settings | File Templates.
 */
class file
{
    public static function write(array $data = array())
    {
        $default = array(
            'file' => conf::$path.'log/test.log',
            'text' => date('Y-m-d H:i:s').' text',
        );

        $data = array_merge($default, $data);

        $f = fopen($data['file'], 'a+');
        fwrite($f, $data['text']);

        if (file_exists($data['file']))
        {
            return true;
        }
        return false;
    }
}
